/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Andre
 */
@Embeddable
public class ItensvendaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "idVenda", nullable = false)
    private int idVenda;
    @Basic(optional = false)
    @NotNull
    @Column(name = "item", nullable = false)
    private int item;

    public ItensvendaPK() {
    }

    public ItensvendaPK(int idVenda, int item) {
        this.idVenda = idVenda;
        this.item = item;
    }

    public int getIdVenda() {
        return idVenda;
    }

    public void setIdVenda(int idVenda) {
        this.idVenda = idVenda;
    }

    public int getItem() {
        return item;
    }

    public void setItem(int item) {
        this.item = item;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idVenda;
        hash += (int) item;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItensvendaPK)) {
            return false;
        }
        ItensvendaPK other = (ItensvendaPK) object;
        if (this.idVenda != other.idVenda) {
            return false;
        }
        if (this.item != other.item) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.ItensvendaPK[ idVenda=" + idVenda + ", item=" + item + " ]";
    }
    
}
